package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.GoodsSalesDTO;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderMapper {
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void inser(Orders orders);

    List<Orders> list(Long userId);

    List<Long> select(LocalDateTime minusMinutes);

    int update(Orders orders, List<Long> ids);

    Page<OrderVO> pageQuery(Orders orders);

    Orders orderById(Long id);

    Double turnoverStatistics(LocalDateTime min, LocalDateTime max, Integer status);

    int orderStatistics(LocalDateTime min, LocalDateTime max, Integer status);

    List<GoodsSalesDTO> getSalesTop10(LocalDateTime begin, LocalDateTime end);

    void updateStatus(OrderVO vo);

    Page<OrderVO> conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO);

}
